<script type='text/javascript'>
function validate_int(field,event) {
	var key = window.event ? window.event.which : event.which;
	if (key >= '0'.charCodeAt(0) && key <= '9'.charCodeAt(0)) return true;
	if (key == 37 || key == 39 || key == 16 || key == 46 || key == 8 || key == 9) return true;
	return false; 
}
function validate_double(field,event) {
	var key = window.event ? window.event.which : event.which;
	if (key >= '0'.charCodeAt(0) && key <= '9'.charCodeAt(0)) return true;
	if (key == '.'.charCodeAt(0)) return true;
	if (key == 37 || key == 39 || key == 16 || key == 46 || key == 8 || key == 9) return true;
	return false; 
}
function validate_time(field) {
	var v = field.value;
	var h = "";
	var m = "";
	var is_m = false;
	for (var i = 0; i < v.length; ++i)
		if (v.charCodeAt(i) >= '0'.charCodeAt(0) && v.charCodeAt(i) <= '9'.charCodeAt(0))
			if (is_m) m += v[i]; else h += v[i];
		else if (v[i] == ":") is_m = true;
	h = parseInt(h);
	if (h+"" == "NaN") h = 0;
	m = parseInt(m);
	if (m+"" == "NaN") m = 0;
	v = h+":"+m;
	if (field.value != v) field.value = v;
}
</script>
